<?php 
require_once('inc_admin.php');
connect();
$sql="select * from category"; 
$result = fetch_array($sql);
 ?> 
<!doctype html>
<html>
 <head>
  <meta charset="UTF-8">
  <title>添加家具</title>
 </head>
 <body>
  <form method=post action="doadd.php" enctype="multipart/form-data" >
  <table  border="1">
  <tr>
  <td>家具名称</td>   
  <td><input type="text" name="zq_name" required></td>
  </tr>

  <th>所属类别：</th>   
  <td>
  <select name="zq_cid">
    <option >==请选择</option>
    <?php 
      foreach ($result as $one) {
        echo '<option value="'.$one['zq_cid'].'">'.$one['zq_cname'].'</option>';
      }
     ?>
  </select>
  </td>

  <tr>
  <td>产地</td>   
  <td><input type="text" name="zq_brand"></td>
  </tr>
  <tr>
  <td>上传照片</td> 
  <td>
  <input type="file" name="zq_jiajulink">
  </td>
  </tr> 
  <tr>
  <td>家具介绍</td>   
  <td>
  <input type="text" name="zq_intro">
  </td>
  </tr>
  <tr>
  <td colspan="2">
  <input type="submit" value="添加">
  </td>
  </tr>
 </table>
 </form>
 </body>
</html>